package com.renting.modules.timer.web;


import com.renting.common.config.HttpStatusConstant;
import com.renting.common.entity.Result;
import com.renting.modules.timer.TimerSchedule;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * 定时器控制
 */
@Controller
public class TimerController {


    @RequestMapping(value = "v1/sys/timers", method = RequestMethod.GET)
    @ResponseBody
    public Map timers() {
        return TimerSchedule.scheduleMap;
    }

    @RequestMapping(value = "v1/sys/timers/name/{name}")
    @ResponseBody
    public Result timers(String name) {

        Result result = new Result();
        TimerSchedule.scheduleMap.forEach((k, v) -> {

        });

        result.setMsg(HttpStatusConstant.SUCCESS, "我想取消" + name);
        return result;
    }
}
